<!--
	作者：956911785@qq.com
	时间：2019年8月7日10:13:46
	描述：书籍-添加
-->

<template>
	<Tcontent ref="Tcontent" :teas="params" :title="title" @addsave="addsave"></Tcontent>
</template>

<script>
	import Tcontent from "./Tcontent";
	export default {
		name:"addBook",
		props: {
			bid:{
    			type: String
    		},	
    	},
		data() {
			return {
				params:{
					qid:'', 
					tmnr:'', 
					tx:'', 
					answer:'', 
					ad:'', 
					bd:'', 
					cd:'', 
					dd:'', 
					ed:'', 
					fd:''
				},
				title:'添加题目'
			}
		},
		components: {
			Tcontent
		},
		methods: {
			addsave:function(datas){
				const da={...datas};
				const params={
					tmnr:da.tmnr, 
					tx:da.tx, 
					answer:da.answer, 
					bid:this.bid, 
					ad:da.ad, 
					bd:da.bd, 
					cd:da.cd, 
					dd:da.dd, 
					ed:da.ed, 
					fd:da.fd
				};
                this.$http.post("/host/readbook/sjgl/InsertBookQuestion.html",params)
				.then(result => {
					if(result){
						this.$Modal.success({
                            title: "提示",
                            content: "添加成功！"
                       });
                       this.$emit("reload");
                       this.$refs.Tcontent.closeModal();
					}else{
						this.$Modal.error({
                            title: "提示",
                            content: "添加失败，请联系管理员！"
                       });	
					}
				});
	        },
			openmodal(){
				this.$refs.Tcontent.modal0 = true;
			}
		},
		mounted() {

		},
		watch:{
			
		}
	}
</script>

<style scoped="scoped">
	
</style>



